.class public Lcom/xingbook/service/download/DownloadService;
.super Landroid/app/Service;


# instance fields
.field a:Ljava/util/HashMap;

.field b:Landroid/os/Messenger;

.field c:Ljava/util/HashMap;

.field d:Lcom/xingbook/service/download/l;

.field e:Ljava/util/List;

.field f:Landroid/net/wifi/WifiManager$WifiLock;

.field private g:Lcom/xingbook/service/download/m;

.field private h:Landroid/os/Handler;

.field private final i:Landroid/os/Messenger;


# direct methods
.method public constructor <init>()V
    .locals 2

    const/4 v0, 0x0

    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    new-instance v0, Lcom/xingbook/service/download/h;

    invoke-direct {v0, p0}, Lcom/xingbook/service/download/h;-><init>(Lcom/xingbook/service/download/DownloadService;)V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->g:Lcom/xingbook/service/download/m;

    new-instance v0, Lcom/xingbook/service/download/i;

    invoke-direct {v0, p0}, Lcom/xingbook/service/download/i;-><init>(Lcom/xingbook/service/download/DownloadService;)V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->h:Landroid/os/Handler;

    new-instance v0, Landroid/os/Messenger;

    iget-object v1, p0, Lcom/xingbook/service/download/DownloadService;->h:Landroid/os/Handler;

    invoke-direct {v0, v1}, Landroid/os/Messenger;-><init>(Landroid/os/Handler;)V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->i:Landroid/os/Messenger;

    return-void
.end method


# virtual methods
.method public a()Ljava/util/Collection;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0}, Lcom/xingbook/service/download/l;->b()Ljava/util/Collection;

    move-result-object v0

    return-object v0
.end method

.method public a(Lcom/xingbook/service/download/k;)V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Lcom/xingbook/service/download/k;)Z

    new-instance v1, Lcom/xingbook/service/download/j;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->g:Lcom/xingbook/service/download/m;

    invoke-direct {v1, p1, v0}, Lcom/xingbook/service/download/j;-><init>(Lcom/xingbook/service/download/k;Lcom/xingbook/service/download/m;)V

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {p1}, Lcom/xingbook/service/download/k;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-virtual {p1}, Lcom/xingbook/service/download/k;->g()I

    move-result v2

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/concurrent/ExecutorService;

    if-eqz v0, :cond_0

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    :cond_0
    return-void
.end method

.method a(Ljava/lang/String;)Z
    .locals 2

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->e:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_1

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0
.end method

.method public b(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->b()I

    move-result v0

    const/4 v1, 0x3

    if-ne v0, v1, :cond_1

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/j;

    if-eqz v0, :cond_1

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/j;->a(Z)V

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->e:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_1
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->g:Lcom/xingbook/service/download/m;

    invoke-interface {v0, p1}, Lcom/xingbook/service/download/m;->a_(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public c(Ljava/lang/String;)V
    .locals 6

    const/4 v2, 0x4

    const/4 v3, 0x1

    const/4 v5, 0x0

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-nez v0, :cond_4

    invoke-virtual {p0}, Lcom/xingbook/service/download/DownloadService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->g()Lcom/xingbook/park/d/e;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/xingbook/park/d/e;->f(Ljava/lang/String;)Lcom/xingbook/service/download/g;

    move-result-object v1

    if-eqz v1, :cond_3

    invoke-virtual {v0, v1}, Lcom/xingbook/park/d/e;->a(Lcom/xingbook/service/download/g;)V

    invoke-virtual {v1}, Lcom/xingbook/service/download/g;->c()I

    move-result v0

    if-ne v0, v3, :cond_1

    new-instance v2, Lcom/xingbook/xingbook/b/a;

    invoke-direct {v2, v1}, Lcom/xingbook/xingbook/b/a;-><init>(Lcom/xingbook/service/download/g;)V

    new-instance v1, Lcom/xingbook/xingbook/c/b;

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v3

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/f;

    const/4 v4, 0x0

    invoke-direct {v1, v3, v2, v0, v4}, Lcom/xingbook/xingbook/c/b;-><init>(Landroid/content/Context;Lcom/xingbook/xingbook/b/a;Lcom/xingbook/service/download/f;Lcom/xingbook/xingbook/c/d;)V

    invoke-virtual {v1, v5}, Lcom/xingbook/xingbook/c/b;->a(I)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {v1}, Lcom/xingbook/service/download/g;->c()I

    move-result v0

    if-eq v0, v2, :cond_2

    invoke-virtual {v1}, Lcom/xingbook/service/download/g;->c()I

    move-result v0

    const/4 v2, 0x3

    if-ne v0, v2, :cond_0

    :cond_2
    new-instance v2, Lcom/xingbook/audio/b/b;

    invoke-direct {v2, v1}, Lcom/xingbook/audio/b/b;-><init>(Lcom/xingbook/service/download/g;)V

    new-instance v1, Lcom/xingbook/audio/c/c;

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v3

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/f;

    invoke-direct {v1, v3, v2, v0}, Lcom/xingbook/audio/c/c;-><init>(Landroid/content/Context;Lcom/xingbook/audio/b/b;Lcom/xingbook/service/download/f;)V

    invoke-virtual {v1}, Lcom/xingbook/audio/c/c;->a()V

    goto :goto_0

    :cond_3
    invoke-virtual {p0, p1}, Lcom/xingbook/service/download/DownloadService;->b(Ljava/lang/String;)V

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    const-string v1, "\u4e0b\u8f7d\u5730\u5740\u83b7\u53d6\u5931\u8d25\uff0c\u4fe1\u606f\u5df2\u6e05\u9664"

    invoke-static {v0, v1, v5}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto :goto_0

    :cond_4
    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->b()I

    move-result v1

    if-eq v1, v2, :cond_5

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->b()I

    move-result v1

    if-eqz v1, :cond_5

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->b()I

    move-result v1

    const/4 v2, 0x6

    if-ne v1, v2, :cond_0

    :cond_5
    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->b()I

    move-result v1

    if-eqz v1, :cond_6

    invoke-virtual {v0, v3}, Lcom/xingbook/service/download/k;->a(I)V

    :cond_6
    new-instance v1, Lcom/xingbook/service/download/j;

    iget-object v2, p0, Lcom/xingbook/service/download/DownloadService;->g:Lcom/xingbook/service/download/m;

    invoke-direct {v1, v0, v2}, Lcom/xingbook/service/download/j;-><init>(Lcom/xingbook/service/download/k;Lcom/xingbook/service/download/m;)V

    iget-object v2, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v2, p1, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/concurrent/ExecutorService;

    if-eqz v0, :cond_0

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    goto :goto_0
.end method

.method public d(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/j;

    if-eqz v0, :cond_0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/j;->a(Z)V

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    return-void
.end method

.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->i:Landroid/os/Messenger;

    invoke-virtual {v0}, Landroid/os/Messenger;->getBinder()Landroid/os/IBinder;

    move-result-object v0

    return-object v0
.end method

.method public onCreate()V
    .locals 7

    const/4 v3, 0x1

    const-string v0, "wifi"

    invoke-virtual {p0, v0}, Lcom/xingbook/service/download/DownloadService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/wifi/WifiManager;

    const-string v1, "downloadlock"

    invoke-virtual {v0, v3, v1}, Landroid/net/wifi/WifiManager;->createWifiLock(ILjava/lang/String;)Landroid/net/wifi/WifiManager$WifiLock;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->f:Landroid/net/wifi/WifiManager$WifiLock;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->f:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->acquire()V

    new-instance v0, Ljava/io/File;

    sget-object v1, Lcom/xingbook/c/c;->I:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    :cond_0
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v3}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    const/4 v1, 0x2

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v3}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    const/4 v1, 0x4

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v3}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    const/4 v1, 0x3

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v3}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v0, Lcom/xingbook/service/download/l;

    invoke-direct {v0}, Lcom/xingbook/service/download/l;-><init>()V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->e:Ljava/util/List;

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0}, Lcom/xingbook/service/download/l;->c()[Lcom/xingbook/service/download/k;

    move-result-object v2

    if-eqz v2, :cond_1

    array-length v3, v2

    const/4 v0, 0x0

    move v1, v0

    :goto_0
    if-lt v1, v3, :cond_2

    :cond_1
    return-void

    :cond_2
    aget-object v4, v2, v1

    invoke-virtual {v4}, Lcom/xingbook/service/download/k;->b()I

    move-result v0

    const/4 v5, 0x6

    if-eq v0, v5, :cond_3

    const/4 v5, 0x5

    if-ne v0, v5, :cond_6

    :cond_3
    invoke-virtual {v4}, Lcom/xingbook/service/download/k;->i()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v5

    if-eqz v5, :cond_4

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    :cond_4
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v4}, Lcom/xingbook/service/download/k;->a()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/xingbook/service/download/l;->b(Ljava/lang/String;)Z

    :cond_5
    :goto_1
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0

    :cond_6
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_7
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_5

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/j;

    invoke-virtual {v0}, Lcom/xingbook/service/download/j;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v4}, Lcom/xingbook/service/download/k;->a()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_7

    goto :goto_1
.end method

.method public onDestroy()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->f:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->isHeld()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->f:Landroid/net/wifi/WifiManager$WifiLock;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->release()V

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    if-lez v0, :cond_1

    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_3

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_1

    invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_4

    :cond_1
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_2
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    if-nez v0, :cond_5

    :goto_3
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0}, Lcom/xingbook/service/download/l;->a()V

    invoke-super {p0}, Landroid/app/Service;->onDestroy()V

    return-void

    :cond_3
    :try_start_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_3

    :cond_4
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcom/xingbook/service/download/DownloadService;->d(Ljava/lang/String;)V

    goto :goto_1

    :cond_5
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/concurrent/ExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->isShutdown()Z

    move-result v2

    if-nez v2, :cond_2

    invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->shutdown()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2
.end method

.method public onStartCommand(Landroid/content/Intent;II)I
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public onUnbind(Landroid/content/Intent;)Z
    .locals 3

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    if-lez v0, :cond_0

    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_2

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_3

    :cond_0
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_1
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    if-nez v0, :cond_4

    :goto_3
    iget-object v0, p0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0}, Lcom/xingbook/service/download/l;->a()V

    invoke-virtual {p0}, Lcom/xingbook/service/download/DownloadService;->stopSelf()V

    const/4 v0, 0x1

    return v0

    :cond_2
    :try_start_1
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_3

    :cond_3
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcom/xingbook/service/download/DownloadService;->d(Ljava/lang/String;)V

    goto :goto_1

    :cond_4
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/concurrent/ExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->isShutdown()Z

    move-result v2

    if-nez v2, :cond_1

    invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->shutdown()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2
.end method
